package com.starchen.optimalselection.common.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.starchen.optimalselection.common.valid.AddGroup;
import com.starchen.optimalselection.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 品牌
 *
 * 数据效验规则
 * 自定义规则
 * 1.添加依赖validation-api
 * 2.自定义接口 ListValue
 * 3.接口上添加效验器 ListValueConstraintValidator.class
 * 
 * @author daxilong
 * @email daxilong@gmail.com
 * @date 2022-08-14 19:57:36
 */
@Data
@TableName("pms_brand")
public class Brand implements Serializable {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "品牌id")
	@TableId
	private Long id;

	@ApiModelProperty(value = "品牌名")
	@NotBlank(message = "品牌名不能为空",groups = {AddGroup.class, UpdateGroup.class})
	private String name;

	@ApiModelProperty(value = "品牌logo地址")
	private String logo;

	@ApiModelProperty(value = "品牌介绍")
	private String description;

	@ApiModelProperty(value = "检索首字母")
	private String firstLetter;

	@ApiModelProperty(value = "排序")
	private Integer sort;

	@ApiModelProperty(value = "是否删除")
	@JsonIgnore
	@TableLogic
	private Integer isDeleted;

}
